﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using System.Data;
public partial class Sanphamchitiet : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string a = (Request.QueryString["name"]).ToString();
        int b = Int32.Parse(Request.QueryString["id"]);
        switch (a)
        {
            case "Pgiamgia":
                {
                    PhieuGiamGiaBLL tmp = new PhieuGiamGiaBLL();
                    DataTable c = tmp.selectdetail(b);
                    ten.Text = c.Rows[0][1].ToString();
                    hinhSP.ImageUrl = c.Rows[0][8].ToString();
                    linkweb.Text = c.Rows[0][9].ToString();
                    giaban_sp.Text = c.Rows[0][3].ToString();
                    phantramgiamgia.Text = c.Rows[0][4].ToString() + "%";
                    int day = DateTime.Now.Day;
                    int month = DateTime.Now.Month;
                    int yeah = DateTime.Now.Year;
                    string datetime = c.Rows[0][7].ToString();
                    timeconlai.Text = "cho su li sau";
                    break;
                }
            case "Spgiamgia":
                break;
            case "Ddgiamgia":
                break;
        }


    }
    public int getday(string a)
    {
        int ngay;
        ngay = Int32.Parse(a.Substring(0, 1));
        return ngay;

    }
    public int getmonth(string a)
    {
        int thang;
        thang = Int32.Parse(a.Substring(3, 4));
        return thang;
    }
    public int getyear(string a)
    {
        int nam;
        nam = Int32.Parse(a.Substring(6, 7));
        return nam;
    }
}